//2766.重新放置石块
//https://leetcode.cn/problems/relocate-marbles
class Solution {
public:
    vector<int> relocateMarbles(vector<int>& nums, vector<int>& moveFrom, vector<int>& moveTo) {
        //先将石头加入set去重并排序
        set<int> s {nums.begin(), nums.end()};
        //将moveFrom[i] 在nums中修改为-> moveTo[i]
        for(int i = 0; i < moveFrom.size(); ++i) {
            s.erase(moveFrom[i]);
            s.insert(moveTo[i]);
        }
        return {s.begin(), s.end()};
    }
};